FROM node:10.16.3 as builder
# FROM registry.cn-hangzhou.aliyuncs.com/hrfax/node:12.9.1 as builder
WORKDIR /usr/src/app/
USER root
COPY package.json ./
# RUN apt-get update && apt-get install -y nginx
RUN yarn
COPY . .
RUN npm run build
FROM nginx:latest
WORKDIR /usr/share/nginx/html/
COPY --from=builder /usr/src/app/dist  /usr/share/nginx/html/
COPY ["./nginx/*", "/etc/nginx/"]
RUN rm -f  /etc/nginx/conf.d/default.conf
EXPOSE 80
EXPOSE 443
